from django.shortcuts import render
from django.views import View

# Create your views here.

class IndexView(View):
    def get(self,request):
        return render(request,'index.html')


###############FDFS上传图片的代码##########################
# 以下代码 在python manage.py  shell 中运行
# 1 导入Fdfs库
# from fdfs_client.client import Fdfs_client
# # 2 创建Fdfs客户端实例,让客户端实例加载配置文件
# # 因为配置文件可以找到tracker  server
# client=Fdfs_client('utils/fastdfs/client.conf')
# # 3 上传文件, 注意要使用绝对路径
# client.upload_by_filename('/home/python/Desktop/2.jpg')
'''
getting connection
<fdfs_client.connection.Connection object at 0x7f8358dca748>
<fdfs_client.fdfs_protol.Tracker_header object at 0x7f8358dca710>
{'Group name': 'group1', 'Status': 'Upload successed.', 'Storage IP': '192.168.32.86', 'Local file name': '/home/python/Desktop/1.jpg', 'Remote file_id': 'group1/M00/00/00/wKggVl2wBGWAC3JfAACH70QuaY0826.jpg', 'Uploaded size': '33.00KB'}
'''